/*
 * @Date: 2022-09-28 09:40:48
 * @LastEditors: YeKe
 * @LastEditTime: 2022-10-08 11:48:25
 * @FilePath: \vue3-template\src\router\index.ts
 */
import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

// 2. 配置路由
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    // component: () => import('@/views/demo/index.vue'),
    component: () => import('@/views/index.vue'),
    // children: [
    //   {
    //     path: '/redirect/:path(.*)',
    //     component: () => import('@/views/redirect/index.vue')
    //   }
    // ]
  },
];
// 1.返回一个 router 实列，为函数，里面有配置项（对象） history
const router = createRouter({
  history: createWebHistory(),
  routes,
});

// 3导出路由   然后去 main.ts 注册 router.ts
export default router